package com.demo.my.Service;

import com.demo.my.Dao.DepartmentDao;
import com.demo.my.Entity.Department;

import java.sql.SQLException;
import java.util.List;

import com.demo.my.Dao.EmployeeDao;
import com.demo.my.Entity.Employee;

public class DepartmentService {
    private DepartmentDao departmentDao=new DepartmentDao();
    public Department getDepartment(Integer departmentNumber) throws SQLException {
        return departmentDao.getDepartment(departmentNumber);
    }

    public List<Department> getDepList() throws Exception {
        return departmentDao.getDepList();
    }
    public List<Department> getDepList(String pageNo) throws Exception {
       return departmentDao.getDepList(pageNo);
    }

    public int getDepListCount() throws Exception {
        return departmentDao.getDepListCount();
    }

    public void addDepartment(Department department) throws Exception {
        departmentDao.addDepartment(department);
    }

    public Department getDepById(String id) throws Exception {
       return departmentDao.getDepById(id);
    }

    public void updateDepartment(Department dep) throws Exception {
        departmentDao.updateDepartment(dep);
    }

    public void deleteDepartment(String id) throws Exception {
        departmentDao.deleteDepartment(id);
    }

    public int getMaxNumber() throws Exception {
      return   departmentDao.getMaxNumber();
    }
}
